package com.jizhi.controller;


import com.jizhi.entity.Caigou;
import com.jizhi.service.CaigouService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 王书豪
 * @since 2020-11-18
 */
@RestController
@RequestMapping("/caigou")
public class CaigouController {
    @Resource
    private CaigouService caigouService;
    @ApiOperation(value = "添加或修改采购单信息", notes = "根据采购单实体添加或修改采购单信息")
    @ApiImplicitParam(name = "caigou", value = "挂机采购单实体caigou", required = true, dataType = "Caigou")
    @PostMapping("/upinsertBy")
    public String upinsertBy(Caigou caigou){
        int num= caigouService.updateCaigou(caigou);
        if (num>0){
            return "添加成功";
        }else {
            return "添加失败";
        }
    }
}

